-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cat-log: list out/err files when available via tailer #6480
cat-log: list out/err files when available via tailer #6480
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
320f8f4
to
39e17e5
Compare
39e17e5
to
f8a248c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Read code
- Ran new test
- Tried manually testing, including looking at available log files in TUI before and after.
- Ran new test with coverage. Lines indicated in the diff were covered.
proc = remote_cylc_cmd( | ||
cmd, | ||
platform, | ||
capture_process=False, | ||
capture_process=(mode == 'list-dir'), | ||
manage=(mode == 'tail'), | ||
text=False | ||
text=(mode == 'list-dir'), | ||
) | ||
if ( | ||
mode == 'list-dir' | ||
and os.path.exists( | ||
os.path.join( | ||
local_log_dir, | ||
'job-activity.log' | ||
) | ||
) | ||
): | ||
# add the local-only job-activity.log file to the remote-list | ||
print('job-activity.log') | ||
|
||
# add and missing items to file listing results | ||
if isinstance(proc, Popen): | ||
# i.e: if mode=='list-dir' and ctrl+c not pressed | ||
out, err = proc.communicate() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to include the proc.communicate()
in the suppressing of the KeyboardInterrupt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a suppress
block, so the code execution will continue on if KeyboardInterrupt
is caught leading to an error further on in the code.
As it stands, if you ctrl+c here, you'll get a KeyboardInterrupt traceback:
Traceback (most recent call last):
...
KeyboardInterrupt
But if we do the awaiting inside this block, it just turns into a different error:
Traceback (most recent call last):
...
File "cylc/flow/scripts/cat_log.py", line 607, in _main
AttributeError: 'NoneType' object has no attribute 'splitlines'
I don't think kill signals are very well handled here at present, not really the fault of this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the whole if isinstance
block is included in the suppress
block, it avoids traceback on ctrl+c. But not that important I guess
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The traceback is a cosmetic problem, but I think there are pre-existing functional issues here, #6609
d46501f
to
beb2a09
Compare
* The `--mode=list-dir` option lists log files which are available to view. * This commit includes remote `job.out` and `job.err` files which are available via platform tailer/viewer commands. * Note, these log files are only listed if accessible via *both* a tailer and a viewer in order to prevent ambiguity (these are typically configured together anyway).
beb2a09
to
4714a46
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Take or leave my KeyboardInterrupt suggestions
I think we need to do more than just swallow the traceback. Have opened an issue: #6609 |
Closes #5802
List log files that are not present on disk but which are available via a tailer.
Check List
CONTRIBUTING.md
and added my name as a Code Contributor.setup.cfg
(andconda-environment.yml
if present).?.?.x
branch.